import groovy.transform.PackageScope
import lombok.Getter
import lombok.experimental.PackagePrivate
import org.junit.jupiter.api.Test
@Getter
class CustomA implements Comparable {
    @PackageScope String name;
    int age;
    float  z1=0.1f;

    CustomA(String name, int age) {
        this.name = name
        this.age = age
    }

    @Override
    int compareTo(Object o) {
        if (!o instanceof CustomA){
            throw new RuntimeException("type incorrect");
        }
        CustomA customA = (CustomA)o;
        if (age>customA.age){
            return 1;
        }else if (age<customA.age){
            return -1;
        }else {
            return this.equals(o);
        }
    }

    public class X{
        public void sayHello(){
            System.out.println("hello");
        }
    }
    public X createX(){
        return new X();
    }

    @Override
    boolean equals(Object obj) {
        CustomA customA = (CustomA)obj;
        if (customA.age==this.age){
            return true
        }else{
            return false;
        }
    }

}